package com.volcreate.week1;

import java.util.Random;
import java.util.Scanner;

/**
 * @author zxc
 * @date 2020/9/20
 */
public class Main6 {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        long seed = scanner.nextLong();
        int n = scanner.nextInt();
        Random r = new Random(seed);
        int count = 0;
        for (int i = 0; i < n; i++) {
            double x = r.nextDouble() * 2 - 1;
            double y = r.nextDouble() * 2 - 1;
            if (x * x + y * y <= 1) count++;
        }
        System.out.println(4 * (double) count / n);
    }

}
